from typing import Optional

from pydantic import EmailStr

from pydantic import BaseModel


class IUserRegister(BaseModel):
    name: str
    login: str
    password: str
    id_role: int
    Id_level_worker: int


class IUserRead(BaseModel):
    name: str
    id_role: int
    login: str
    id: int
    Id_level_worker: int

    class Config:
        from_attributes = True


class IUserUpdate(BaseModel):
    id: int
    login: str

class IUserModify(BaseModel):
    name: str | None
    login: str | None
    password: str | None
    id_role: int | None
    Id_level_worker: int | None

# class IUserCreate(IUserRegister):
#     role_id: int = 1
